package com.aia.ilp.persistence.sqlmapdao;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.aia.ilp.domain.Cust;
import com.aia.ilp.domain.CustExample;
import com.aia.ilp.persistence.dao.CustDAO;

public class CustDAOImpl extends SqlMapClientDaoSupport implements CustDAO {
	
	public int mm_countByExample(CustExample example) {
		com.cfh.ahead.CountHolder count = (com.cfh.ahead.CountHolder) getSqlMapClientTemplate().queryForObject("ILP_CUST.mm_countByExample", example);
		return count.getCNT().intValue();
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table ILP_CUST
	 * @ibatorgenerated  Mon Sep 19 04:51:21 GMT 2011
	 */
	public CustDAOImpl() {
		super();
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table ILP_CUST
	 * @ibatorgenerated  Mon Sep 19 04:51:21 GMT 2011
	 */
	public int countByExample(CustExample example) {
		Integer count = (Integer) getSqlMapClientTemplate().queryForObject("ILP_CUST.ibatorgenerated_countByExample", example);
		return count.intValue();
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table ILP_CUST
	 * @ibatorgenerated  Mon Sep 19 04:51:21 GMT 2011
	 */
	public int deleteByExample(CustExample example) {
		int rows = getSqlMapClientTemplate().delete("ILP_CUST.ibatorgenerated_deleteByExample", example);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table ILP_CUST
	 * @ibatorgenerated  Mon Sep 19 04:51:21 GMT 2011
	 */
	public int deleteByPrimaryKey(String CUST_GUID) {
		Cust key = new Cust();
		key.setCUST_GUID(CUST_GUID);
		int rows = getSqlMapClientTemplate().delete("ILP_CUST.ibatorgenerated_deleteByPrimaryKey", key);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table ILP_CUST
	 * @ibatorgenerated  Mon Sep 19 04:51:21 GMT 2011
	 */
	public void insert(Cust record) {
		getSqlMapClientTemplate().insert("ILP_CUST.ibatorgenerated_insert", record);
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table ILP_CUST
	 * @ibatorgenerated  Mon Sep 19 04:51:21 GMT 2011
	 */
	public void insertSelective(Cust record) {
		getSqlMapClientTemplate().insert("ILP_CUST.ibatorgenerated_insertSelective", record);
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table ILP_CUST
	 * @ibatorgenerated  Mon Sep 19 04:51:21 GMT 2011
	 */
	public List selectByExample(CustExample example) {
		List list = getSqlMapClientTemplate().queryForList("ILP_CUST.ibatorgenerated_selectByExample", example);
		return list;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table ILP_CUST
	 * @ibatorgenerated  Mon Sep 19 04:51:21 GMT 2011
	 */
	public Cust selectByPrimaryKey(String CUST_GUID) {
		Cust key = new Cust();
		key.setCUST_GUID(CUST_GUID);
		Cust record = (Cust) getSqlMapClientTemplate().queryForObject("ILP_CUST.ibatorgenerated_selectByPrimaryKey", key);
		return record;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table ILP_CUST
	 * @ibatorgenerated  Mon Sep 19 04:51:21 GMT 2011
	 */
	public int updateByExampleSelective(Cust record, CustExample example) {
		UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
		int rows = getSqlMapClientTemplate().update("ILP_CUST.ibatorgenerated_updateByExampleSelective", parms);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table ILP_CUST
	 * @ibatorgenerated  Mon Sep 19 04:51:21 GMT 2011
	 */
	public int updateByExample(Cust record, CustExample example) {
		UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
		int rows = getSqlMapClientTemplate().update("ILP_CUST.ibatorgenerated_updateByExample", parms);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table ILP_CUST
	 * @ibatorgenerated  Mon Sep 19 04:51:21 GMT 2011
	 */
	public int updateByPrimaryKeySelective(Cust record) {
		int rows = getSqlMapClientTemplate().update("ILP_CUST.ibatorgenerated_updateByPrimaryKeySelective", record);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table ILP_CUST
	 * @ibatorgenerated  Mon Sep 19 04:51:21 GMT 2011
	 */
	public int updateByPrimaryKey(Cust record) {
		int rows = getSqlMapClientTemplate().update("ILP_CUST.ibatorgenerated_updateByPrimaryKey", record);
		return rows;
	}

	/**
	 * This class was generated by Apache iBATIS ibator. This class corresponds to the database table ILP_CUST
	 * @ibatorgenerated  Mon Sep 19 04:51:21 GMT 2011
	 */
	private static class UpdateByExampleParms extends CustExample {
		private Object record;

		public UpdateByExampleParms(Object record, CustExample example) {
			super(example);
			this.record = record;
		}

		public Object getRecord() {
			return record;
		}
	}
	
	
	public List selectByExample(CustExample example, int start, int limit) {
		List list = getSqlMapClientTemplate().queryForList("ILP_CUST.ibatorgenerated_selectByExample", example, start, limit);
		return list;
	}
}